<%@ page language="java" contentType="image/gif"  pageEncoding="UTF-8"%>
<%@page import="java.awt.image.BufferedImage"%>
<%@page import="java.awt.Graphics"%>
<%@page import="com.sun.image.codec.jpeg.JPEGImageEncoder"%>
<%@page import="com.sun.image.codec.jpeg.JPEGCodec"%>
<%@page import="java.awt.Color"%>
<%
  //產生1px的空白圖
    try {
        response.setContentType("image/gif");
        BufferedImage   image=new   BufferedImage(1,1,BufferedImage.TYPE_INT_RGB);    
        Graphics gra=image.getGraphics();    
        gra.setColor(Color.WHITE);
        gra.fillRect(0,0,1,1);
        ServletOutputStream sos = response.getOutputStream();
        JPEGImageEncoder  encoder=JPEGCodec.createJPEGEncoder(sos);    
        encoder.encode(image);
        sos.flush();
        sos.close();
        sos=null;
        response.flushBuffer();
        out.clear();
        out = pageContext.pushBody();
    } catch (Exception e) {
      //e.printStackTrace();
    }
%>